----------------------------------------------------------------------------------
-- Company: 			Grand Valley State University
-- Engineer: 			Jeff VanOss
-- 
-- Create Date:   	22:34:39 01/19/2010 
-- Design Name: 		Seven Segment Driver
-- Module Name:    	SevenSegDriver - Behavioral 
-- Project Name: 		Project 1: Combination Lock
-- Target Devices:	Nexys2
-- Tool versions: 
-- Description: 		This module will display the number represented by the 4 bit
--					 		vector DisplayNumber and display it on the las seven segment LED
--							This function will only display the numbers 0-9 on a 
--							single seven segment LED display.
--
-- Dependencies: 
--
-- Revision: 
-- Revision 0.01 - File Created
-- Additional Comments: 
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;

entity SevenSegDriver is
    Port ( displayNumber : in  STD_LOGIC_VECTOR (3 downto 0);
           segmentLine : out  STD_LOGIC_VECTOR (6 downto 0);
			  anodes : out STD_LOGIC_VECTOR (3 downto 0));
end SevenSegDriver;

architecture Behavioral of SevenSegDriver is

begin
	anodes <= "0000";

	process (displayNumber)
	begin
		--set the output to display the correct number
		case(displayNumber) is
		when "0000" => --0
			segmentLine <= "1000000";
		when "0001" =>	--1
			segmentLine <= "1111001";
		when "0010" =>	--2
			segmentLine <= "0100100";
		when "0011" =>	--3
			segmentLine <= "0110000";
		when "0100" =>	--4
			segmentLine <= "0011001";
		when "0101" =>	--5
			segmentLine <= "0010010";
		when "0110" =>	--6
			segmentLine <= "0000010";
		when "0111" =>	--7
			segmentLine <= "1011000";
		when "1000" =>	--8
			segmentLine <= "0000000";
		when "1001" =>	--9
			segmentLine <= "0011000";
		when others =>	--off
			segmentLine <= "1111111";
		end case;
	end process;

end Behavioral;